package com.alex.httphack;

import java.io.IOException;

import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.protocol.HttpContext;

import com.alex.common.ILogger;

public class HackHttpRequestInterceptor implements HttpRequestInterceptor,
		ILogger {
	@Override
	public void process(final HttpRequest request, final HttpContext context)
			throws HttpException, IOException {
		logger_common.info("--------request headers--------");
		logger_common.info(String.format("method: %s, uri: %s", context
				.getAttribute("method"), request.getRequestLine().getUri()));
		logger_common
				.info(HeaderFactory.formatHeaders(request.getAllHeaders()));
	}
}
